<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String IP = request.getRemoteAddr();
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录页面</title>
<style>
body {
	font-size: 14px;
	background-image: url(images/hotelDoor.jpg);
	background-repeat:no-repeat ;
	background-size:100% 100%; 
	background-attachment:fixed;
}

table {
	position: absolute;
	left: 45%;
	top: 15%;
	color: black;
}
</style>
</head>
<body>
	<form action="login/login.action" method="post" id="form">
		<table border="1">
			<tr>
				<td>用户名</td>
				<td><input type="text" pattern="\w{6,16}" title="输入6-16位的英文或数字"
					id="sUserName" name="sUserName" onchange="namechange(this)" /></td>
			</tr>
			<tr>
				<td>密码</td>
				<td><input type="password" pattern="\w{6,16}"
					title="输入6-16位的英文或数字" id="sPassword" name="sPassword" 
					onchange="passchange(this)"/></td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="checkbox" name="aotulogon"
					value="1" id="aotulogon" />自动登陆</td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="submit" value="登录" /> <input
					type="reset" value="重置"></td>
			</tr>
		</table>
	</form>
</body>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
	function namechange(textObj) {
		var name = textObj.value;
		if ("" == name) {
			alert("用户名不能为空");
			return false;
		}
	}
	function passchange(textObj) {
		var pass = textObj.value;
		if ("" == pass) {
			alert("密码不能为空");
			return false;
		}
	}
	var str="<%=request.getAttribute("status")%>";
	function loginFalse(){
		if(str=="-1"){
			alert("登录失败！！！");
		}
	}
	loginFalse();
</script>
</html>